import request from "@/request/api";

//菜单分类树接口
//1.菜单分类树查询接口
export function menuTreeData(data) {
  return request({
    url: "/eam-service-system/system/menu/queryMenuTree",
    method: "get",
    params: data,
  });
}
//2、根据父节点查询菜单列表
export function queryMenuList(data) {
  return request({
    url: "/eam-service-system/system/menu/queryMenuList",
    method: "get",
    params: {
      ...data,
      page: 1,
      pageSize: 30
    },
  });
}
//3、新增菜单
export function addMenu(data) {
  return request({
    url: "/eam-service-system/system/menu/insertMenu",
    method: "post",
    data: data,
  });
}
//4、修改菜单
export function editMenu(data) {
  return request({
    url: "/eam-service-system/system/menu/updateMenu",
    method: "put",
    data: data,
  });
}
export function deleteMenuList(data) {
  return request({
    url: "/eam-service-system/system/menu/deleteList",
    method: "delete",
    params: data,
  });
}

//根据应用查询角色列表
export function queryOrgList(data) {
  return request({
    url: "/eam-service-system/system/role/queryOrgList",
    method: "get",
    params: data,
  });
}

//新增角色
export function addCharacter(data) {
  return request({
    url: "/eam-service-system/system/role/insertRole",
    method: "post",
    data: data,
  });
}

//修改角色
export function editCharacter(data) {
  return request({
    url: "/eam-service-system/system/role/updateRole",
    method: "put",
    data: data,
  });
}

//删除角色
export function deleteCharacter(data) {
  return request({
    url: "/eam-service-system/system/role/deleteList",
    method: "delete",
    params: data,
  });
}

//查询角色权限
export function queryAppAllInfoJurisdiction(data) {
  return request({
    url: "/eam-service-system/system/role/queryAppAllInfoJurisdiction",
    method: "get",
    params: data,
  });
}

//查询角色用户权限
export function queryUserJurisdiction(data) {
  return request({
    url: "/eam-service-system/system/role/queryUserJurisdiction",
    method: "get",
    params: data,
  });
}
//查询角色权限
export function saveRoleJurisdiction(data) {
  return request({
    url: "/eam-service-system/system/role/saveRoleJurisdiction",
    method: "post",
    data: data,
  });
}

// //删除组织权限
// export function deleteCharacter(data) {
//   return request({
//     url: "/eam-service-system/system/role/deleteList",
//     method: "delete",
//     params: data,
//   });
// }

// //删除菜单权限
// export function deleteCharacter(data) {
//   return request({
//     url: "/eam-service-system/system/role/deleteList",
//     method: "delete",
//     params: data,
//   });
// }

// //查询已选人员
// export function deleteCharacter(data) {
//   return request({
//     url: "/eam-service-system/system/role/deleteList",
//     method: "delete",
//     params: data,
//   });
// }

// //保存权限
// export function deleteCharacter(data) {
//   return request({
//     url: "/eam-service-system/system/role/deleteList",
//     method: "delete",
//     params: data,
//   });
// }
